From 55c771f676873ff66102be3826ed88f53ab57578 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 21 Jul 2005 15:50:11 +0000 Subject: [PATCH] Here is a patch to enable Xen to run on a Unisys ES7000 x86_64 system. Signed-off-by: Aravindh Puthiyaparambil --- xen/arch/x86/genapic/es7000plat.c | 16 +++++++-- xen/arch/x86/io_apic.c | 11 +++--- xen/arch/x86/mpparse.c | 35 +++++++++++++++++--- xen/include/asm-x86/apicdef.h | 7 ++-- xen/include/asm-x86/genapic.h | 2 -- xen/include/asm-x86/mach-bigsmp/mach_apic.h | 2 -- xen/include/asm-x86/mach-default/mach_apic.h | 2 -- xen/include/asm-x86/mach-es7000/mach_apic.h | 2 -- xen/include/asm-x86/mach-generic/mach_apic.h | 1 - xen/include/asm-x86/mach-summit/mach_apic.h | 2 -- 10 files changed, 56 insertions(+), 24 deletions(-) diff --git a/xen/arch/x86/genapic/es7000plat.c b/xen/arch/x86/genapic/es7000plat.c index 8bf571bd27..1f7150f9f9 100644 --- a/xen/arch/x86/genapic/es7000plat.c +++ b/xen/arch/x86/genapic/es7000plat.c @@ -136,7 +136,19 @@ parse_unisys_oem (char *oemptr, int oem_entries) es7000_plat = 0; } else { printk("\nEnabling ES7000 specific features...\n"); - es7000_plat = 1; + /* + * Determine the generation of the ES7000 currently running. + * + * es7000_plat = 0 if the machine is NOT a Unisys ES7000 box + * es7000_plat = 1 if the machine is a 5xx ES7000 box + * es7000_plat = 2 if the machine is a x86_64 ES7000 box + * + */ + if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2)) + es7000_plat = 2; + else + es7000_plat = 1; + ioapic_renumber_irq = es7000_rename_gsi; } return es7000_plat; @@ -286,7 +298,7 @@ es7000_stop_cpu(int cpu) void __init es7000_sw_apic() { - if (es7000_plat) { + if (es7000_plat == 1) { int mip_status; struct mip_reg es7000_mip_reg; diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 255b590758..db3cd010a8 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -955,6 +955,13 @@ static void __init setup_ioapic_ids_from_mpc(void) unsigned char old_id; unsigned long flags; + /* + * Don't check I/O APIC IDs for xAPIC systems. They have + * no meaning without the serial APIC bus. + */ + if (!(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && boot_cpu_data.x86 < 15)) + return; + /* * This is broken; anything with a real cpu count has to * circumvent this idiocy regardless. @@ -981,10 +988,6 @@ static void __init setup_ioapic_ids_from_mpc(void) mp_ioapics[apic].mpc_apicid = reg_00.bits.ID; } - /* Don't check I/O APIC IDs for some xAPIC systems. They have - * no meaning without the serial APIC bus. */ - if (NO_IOAPIC_CHECK) - continue; /* * Sanity check, is the ID really free? Every APIC in a * system must have a unique ID or we get lots of nice diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c index 234b14106f..268c9cdf71 100644 --- a/xen/arch/x86/mpparse.c +++ b/xen/arch/x86/mpparse.c @@ -913,7 +913,10 @@ void __init mp_register_ioapic ( mp_ioapics[idx].mpc_apicaddr = address; set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); - mp_ioapics[idx].mpc_apicid = io_apic_get_unique_id(idx, id); + if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 < 15)) + mp_ioapics[idx].mpc_apicid = io_apic_get_unique_id(idx, id); + else + mp_ioapics[idx].mpc_apicid = id; mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx); /* @@ -995,9 +998,9 @@ void __init mp_config_acpi_legacy_irqs (void) Dprintk("Bus #%d is ISA\n", MP_ISA_BUS); /* - * ES7000 has no legacy identity mappings + * Older generations of ES7000 have no legacy identity mappings */ - if (es7000_plat) + if (es7000_plat == 1) return; /* @@ -1053,11 +1056,20 @@ void __init mp_config_acpi_legacy_irqs (void) } } +#define MAX_GSI_NUM 4096 + int mp_register_gsi (u32 gsi, int edge_level, int active_high_low) { int ioapic = -1; int ioapic_pin = 0; int idx, bit = 0; + static int pci_irq = 16; + /* + * Mapping between Global System Interrups, which + * represent all possible interrupts, and IRQs + * assigned to actual devices. + */ + static int gsi_to_irq[MAX_GSI_NUM]; #ifdef CONFIG_ACPI_BUS /* Don't set up the ACPI SCI because it's already set up */ @@ -1092,11 +1104,26 @@ int mp_register_gsi (u32 gsi, int edge_level, int active_high_low) if ((1<ESR_DISABLE) #define NO_BALANCE_IRQ (genapic->no_balance_irq) -#define NO_IOAPIC_CHECK (genapic->no_ioapic_check) #define INT_DELIVERY_MODE (genapic->int_delivery_mode) #define INT_DEST_MODE (genapic->int_dest_mode) #undef APIC_DEST_LOGICAL diff --git a/xen/include/asm-x86/mach-summit/mach_apic.h b/xen/include/asm-x86/mach-summit/mach_apic.h index 61cac6b453..c43074a7ae 100644 --- a/xen/include/asm-x86/mach-summit/mach_apic.h +++ b/xen/include/asm-x86/mach-summit/mach_apic.h @@ -7,8 +7,6 @@ #define esr_disable (1) #define NO_BALANCE_IRQ (0) -#define NO_IOAPIC_CHECK (1) /* Don't check I/O APIC ID for xAPIC */ - /* In clustered mode, the high nibble of APIC ID is a cluster number. * The low nibble is a 4-bit bitmap. */ #define XAPIC_DEST_CPUS_SHIFT 4 -- 2.30.2